

  <script>
    function getQueryString(name) {
         var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
         var r = window.location.search.substr(1).match(reg);
         if(r!=null)return  unescape(r[2]); return null;
    }
    
    var openId = getQueryString('openId');
    var access_token = getQueryString('access_token');
    
    if(openId != null && openId != ''){
    	document.cookie = "openId=" + openId;
    }
    if(access_token != null && access_token != ''){
        document.cookie = "access_token=" + access_token;
    }else{
    	var d = new Date();
    	d.setTime(d.getTime() - (1*24*60*60*1000));
    	document.cookie = "access_token=;expires=" + d.toGMTString();
    }
    window.location.href="index.html";
   
  </script>

